/**
 * @properties={typeid:35,uuid:"CAC3234B-55BB-4CDD-90C7-90600450BCB9",variableType:4}
 */
var gEjercicioID = null;

/**
 * @properties={typeid:35,uuid:"d4e8b520-7755-4637-9cf2-11ce4aa23326",variableType:6}
 */
var total_debe = 0;

/**
 * @properties={typeid:35,uuid:"eb352fcd-6a2a-41ab-a9c1-ce2bc4b70e7b",variableType:6}
 */
var total_debe_sub = 0;

/**
 * @properties={typeid:35,uuid:"99bb4484-0ced-468b-9997-9d8413dccf28",variableType:6}
 */
var total_haber = 0;

/**
 * @properties={typeid:35,uuid:"98331fbd-04ba-492d-b577-8a2604052f00",variableType:6}
 */
var total_haber_sub = 0;

/**
 *
 * @properties={typeid:24,uuid:"b4afd0d5-7ea9-400f-a83a-5001f27bdb7c"}
 */
function autoSaveOff()
{
	databaseManager.setAutoSave(false)
}

/**
 *
 * @properties={typeid:24,uuid:"5e729b27-bde8-4d47-a805-327d6f3ae91d"}
 */
function grabar()
{
	var e = databaseManager.saveData()
	//databaseManager.setAutoSave(true)
	return e
}

/**
 *
 * @properties={typeid:24,uuid:"59d3a9cf-3881-4f0d-b6e0-4182ad6cdcd5"}
 */
function rollback()
{
	databaseManager.rollbackEditedRecords()
	//databaseManager.setAutoSave(true)
}

/**
 * Called when the valuelist needs data.
 * @returns {JSDataSet}
 *
 * @properties={typeid:24,uuid:"23DD4D88-FED4-4340-BE5C-4F7525BAE04F"}
 */
function vl_mesAnio() {
	var ds = databaseManager.createEmptyDataSet(12,['displayType'])
	var mes = forms.ejercicios_dtl.fecha_inicio.getMonth()
	var anio = forms.ejercicios_dtl.fecha_inicio.getFullYear()
	
	var dplay = mes + '-' + anio
	var i = mes
	ds.setValue(i,1,dplay)
	i++
	if (i >12)
	{
		i = 1
		anio --
	}
	while (i != mes)
	{
		var dplay = i + '-' + anio
		ds.setValue(i,1,dplay)
		i++
		if (i >12)
		{
			i = 1
			anio --
		}	
	}
	return ds
}

/**
 *
 * @properties={typeid:24,uuid:"2135AF7A-4256-4AA2-BDDD-5794299E5E91"}
 */
function inicial() {
	application.showFormInDialog(forms.pide_ejercicio,-1,-1,-1,-1,'Ejercicio',false,false,'EJERCICIO',true)
}
